using System;
using System.Collections.Generic;
using System.Text;
using LiveStock.dataAccess;
using LiveStock.RssObjects;
using System.Xml;

namespace LiveStock.Evaluation
{
    class MoreoverEvaluation : IEvaluation
    {
        public MoreoverEvaluation() { }

        public List<NewsItem> getNewsItems(string stockSymbol)
        {
            List<NewsItem> theNewsItemList = new List<NewsItem>();
            EvaluationSources.EvaluationSourcesDataTable newsSourcesDataTable = EvaluationSourcesData.EvaluationSourceGetByName("Moreover");
            if (newsSourcesDataTable.Rows.Count > 0)
            {
                NewsItemRssReader.FillNewsItemList(theNewsItemList, newsSourcesDataTable[0].URL + stockSymbol, 
                    newsSourcesDataTable[0].EvaluationSourceID);                
            }
            //Remove first news item as it is an ad on Moreover.
            theNewsItemList.RemoveAt(0);
            return theNewsItemList;
        }
    }
}
